package hafnium.bukkit.pail.pipe.plugins;

import hafnium.bukkit.pail.pipe.PailPipe;
import hafnium.bukkit.pail.pipe.logging.PPLogger;
import hafnium.bukkit.util.Optimizable;

public class PipeProxy {
	private final PailPlugin plugin;
	private final PPLogger logger;

	/**
	 * Constructs a proxy for the specified plugin.
	 * 
	 * @param pailPlugin
	 */
	public PipeProxy(PailPlugin pailPlugin) {
		this.plugin = pailPlugin;
		this.logger = new PPLogger(plugin);
	}

	/**
	 * Returns the logger for the plugin represented by this proxy.
	 * 
	 * @return
	 */
	public PPLogger getLogger() {
		return this.logger;
	}
	
	public void registerOptimizable(Optimizable opt) {
		PailPipe.instance.getOptimizer().register(opt);
	}
}
